<?php

class Posts extends Model {
    var $name = 'Posts';

    function post_content_sanitize($str) {
        add_filter('content_save_pre', 'wp_filter_post_kses');
        return apply_filters('content_save_pre', $str);
    }

    function post_slug_sanitize($slug) {
        $slug = sanitize_title($slug);
        $int_slug = (int)$slug;
        if ($slug == $int_slug . '') {
            $slug =  '';
        }
        return $slug;
    }

    function post_status_sanitize($status) {
        return intval($status);
    }

    function post_content_editor($content) {
        add_filter('the_editor_content', 'wp_richedit_pre');
        return apply_filters('the_editor_content', $content);
    }

}
?>
